package tech.aistar.mapper.massage;

import org.apache.ibatis.annotations.Select;
import tech.aistar.entity.Post;
import tech.aistar.entity.UserInfo;

import java.util.List;

public interface SearchMapper {
    //模糊搜素帖子
    @Select("select * from post where title like concat('%',#{value},'%')")
    List<Post> selPost(String title);

    //按内容模糊查找帖子
    @Select("select * from post where post_content like concat('%',#{value},'%')")
    List<Post> selPosts(String postContent);

    //模糊用户
    @Select("select * from user_info where u_name like concat('%',#{value},'%')")
    List<UserInfo> selUser(String uName);

    //精确查找用户
    @Select("select * from user_info where u_id = #{value}")
    UserInfo selQUser(String uId);
}
